package com.lzw.breezeNovel.model.entity.pojo.user;

import com.lzw.breezeNovel.model.entity.query.BaseQuery;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.model.entity.pojo
 * @date 2025/3/6
 * @description 后台管理圆的表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuppressWarnings("all")
public class AdminLogin extends BaseQuery {

    @Schema(description = "id")
    private Integer id;

    @Schema(description = "用户名")
    @NotEmpty(message = "用户名不能为空")
    private String username;

    @Schema(description = "密码")
    @NotEmpty(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6-20之间")
    private String password;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "手机号")
    @NotEmpty
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "用户类型 0:普通用户 1:管理员")
    private Integer type;

    @Schema(description = "状态 0:禁用 1:正常")
    private Integer status;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime updateTime;
}
